package com.yuchao.springboot.controller;

import com.yuchao.springboot.dto.OrderDTO;
import com.yuchao.springboot.service.IOrderService;
import com.yuchao.springboot.utils.Student;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Import;
import org.springframework.web.bind.annotation.*;

/**
 * @description:
 * @author: xingyuchao
 * @date: 2019-11-07
 */
@Slf4j
@Import(Student.class)
@RestController
@RequestMapping(value="/index")
public class IndexController {

    @Autowired
    @Qualifier("orderServiceImpl")
    private IOrderService orderService;

    @Autowired
    @Qualifier("orderServiceImpl2")
    private IOrderService orderService2;


    @Autowired
    private Student studentsss;


    @GetMapping("/test")
    public void test(){

        studentsss.work();

    }

    @PostMapping("/order")
    public String orderProcessor(@RequestBody OrderDTO request){
        return orderService2.handle(request);
    }
}
